#!/usr/bin/python
# -*- coding: utf-8 -*-
import utlis


class AuthorZiliao(object):
    def __init__(self, data):
        self.id = data['id']
        self.nameStr = utlis.toString(data['nameStr'])
        self.author = utlis.toString(data['author'])
        self.authorID = data['authorID']
        self.ok = data['ok']
        self.noOk = data['noOk']
        content = utlis.toString(data['cont'])
        content = content.replace("'", "\\\'")
        content = content.replace('"', '\\\"')
        self.cont = content
        self.isPass = data['isPass']
        self.ipStr = utlis.toString(data['ipStr'])
        self.creTime = utlis.toString(data['creTime'])
        self.cankao = utlis.toString(data['cankao'])
        self.isYuanchuang = data['isYuanchuang']

    def obj_2_json(self):
        return {
            'id': self.id,
            'author': self.author,
            'nameStr': self.nameStr,
            'authorID': self.authorID
        }